package com.AJava1710D.设计模式.代理模式.dong.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 作者: LCG
 * 日期: 2020/6/28 10:45
 * 描述:
 */
public class My02InvocationHandler implements InvocationHandler {

    private Object testMy00Api;

    public My02InvocationHandler(Object testMy00Api) {
        this.testMy00Api = testMy00Api;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("=========执行业务方法之前添加业务==========");
        Object invoke = method.invoke(testMy00Api, args);
        System.out.println("=========执行业务方法之后添加业务==========");
        return invoke;
    }
}
